/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Excepciones;

import org.apache.log4j.FileAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.SimpleLayout;
import robot_maker.Cliente;
import robot_maker.Manager;

/**
 *
 * @author Carlos
 */
public class ClienteException extends Exception
{
    static Logger logger = Logger.getLogger(Cliente.class);
	public ClienteException (int numError, String mensaje, String metodo)
	{
                SimpleLayout layout = new SimpleLayout();

      FileAppender appender = null;
      try {
         appender = new FileAppender(layout,"log.txt",true);
      } catch(Exception e) {}

      logger.addAppender(appender);
      logger.setLevel((Level) Level.DEBUG);
      logger.info("Clase: Cliente | Metodo: " + metodo + " | Hora: " +
              Manager.now());
      logger.error("#: " + numError + " | " + mensaje);
	}
}